package com.cmxh.shipper.controller;

import com.cmxh.shipper.pojo.DriverUserType;
import com.cmxh.shipper.service.DriverUserTypeService;
import com.cmxh.shipper.util.Code;
import com.cmxh.shipper.util.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class DriverUserTypecontroller {
    @Autowired
    private DriverUserTypeService driverUserTypeService;

    @RequestMapping("/queryAll/{id}")
    public Result queryAll(@PathVariable("id") Integer typeid){
        System.out.println("11111111111"+typeid);
        List<DriverUserType> driverUserTypes = driverUserTypeService.selectAll(typeid);
        if (driverUserTypes!=null){
            return new Result(Code.GET_OK,driverUserTypes,"查询成功");
        }else {
            return new Result(Code.GET_ERR,"查询失败");
        }

    }
}
